package com.totoro.service;

import org.hibernate.Criteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.totoro.dao.BaseHibernateDao;
import com.totoro.dao.MySysRemarkTemplateDao;
import com.totoro.domain.MySysRemarkTemplate;
import com.totoro.domain.MySysRemarkTemplate;
import com.totoro.util.Page;

/*
 * 用户自定义模板service
 */
@Transactional
@Service
public class MySysRemarkTemplateService extends
		BaseService<MySysRemarkTemplate, Integer> {

	private MySysRemarkTemplateDao mySysRemarkTemplateDao;

	@Autowired
	@Override
	public void setBaseDao(
			BaseHibernateDao<MySysRemarkTemplate, Integer> mySysRemarkTemplateDao) {
		// TODO Auto-generated method stub
		this.baseDao = mySysRemarkTemplateDao;
		this.mySysRemarkTemplateDao = (MySysRemarkTemplateDao) mySysRemarkTemplateDao;
	}
	//分页查询通过页号
	public Page<MySysRemarkTemplate> getPagePosts(Integer pageNo,int pageSize){
		Criteria criteria = mySysRemarkTemplateDao.createCriteria();
		return mySysRemarkTemplateDao.pagedQuery(criteria, pageNo, pageSize);
	}
}
